module.exports = {
    type: 'list',
    async fetch({
        args,
        page
    }) {
        let resp = await $http.get(`http://app-cdn.jjwxc.net/androidapi/chapterList?more=0&whole=1&novelId=${args.id}`)
        let list = resp.data.chapterlist
        let items = list.map(data => {

            return {

                id: data.chapterId,
                time: data.chapterdate,
                title: data.chaptername,
                style: 'article',
                link: 'http://app-cdn.jjwxc.net/androidapi/chapterContent?novelId=3595501&chapterId=1',
                author: {
                    name: data.authorName
                },
                summary: data.chapterintro,
                route: $route('types/content', {
                    id: data.novelid,
                    Id: data.chapterid
                }),

            }



        })



        let nextPage = null
        if (list.length > 0) {
            let publishDate = list[list.length - 1].publishDate
            nextPage = Date.parse(publishDate)
        }
        return {
            nextPage: nextPage,
            items: items
        }
    }
}